﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Xml.Linq;
//#JMJ Create_20241215

namespace IHateWorking.Model
{
    public class Converter_AddSpace : IValueConverter
    {
        /// <summary>
        /// 为文本添加空格
        /// </summary>
        /// <param name="value">文本</param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns>折叠/显示</returns>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                string text = " ";
                foreach (char c in value.ToString())
                { text += c.ToString() + " "; }
                return text;
            }
            catch (Exception e)
            {
                string ex = e.ToString();
                return Binding.DoNothing;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return Binding.DoNothing;
        }
    }
}
